package cn.mesmile.order.fallback;

import cn.mesmile.order.dto.Product;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zb
 * @date 2020/12/16 11:37
 * @Description
 */
@Slf4j
public class ProductServiceClientFallbackFactory implements FallbackFactory<ProductServiceClient> {

    @Override
    public ProductServiceClient create(Throwable throwable) {

        return new ProductServiceClient() {

            @Override
            public String get() {
                return "获取产品失败，请稍后重试。";
            }

            @Override
            public Product getProduct(Long productId) {
                return null;
            }

            @Override
            public Boolean update(Long productId, Long number) {
                return null;
            }

        };
    }



}
